/**
 * @author zhaoren
 * @version 1.0
 * @description TODO
 * @date 2020/7/28 16:03
 **/
public class Proxy implements Subject{

    /**
     * 引用被代理对象
     */
    private RealSubject realSubject;

    public void request() {
        if (realSubject == null){
            realSubject = new RealSubject();
        }
        realSubject.request();
        System.out.println("该实体已经被代理，需要收取中间费用");
    }
}
